<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="${request.contextPath}/"/>
    <meta charset="UTF-8">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,minimum-scale=1.0">
    <title>漠河智慧社区</title>
    <link href="Content/wechat/css/reset.css" rel="stylesheet" type="text/css">
    <link href="Content/wechat/css/shengHuo_QYML.css" rel="stylesheet" type="text/css">

    <script src="Content/wechat/js/jquery.min.js"></script>
    <!--字体缩放-->
    <script src="Content/wechat/js/ziti.js"></script>
    <!--end 字体缩放-->
    <!--页码js-->
    <script src="Content/wechat/js/myPagination.js"></script>
    <!--页码-->
    <link href="Content/wechat/css/myPagination.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--header-->

<!--end  header-->
<!--图标-->
<div class="tuBiao_up clearfix">
    <a class="a_icon" target="_self" onclick="queryComany('全部');">
        <img src="Content/wechat/images/All.png">
        <span>全部</span>
    </a>
    <a class="a_icon" target="_self" onclick="queryComany('政府机关');">
        <img src="Content/wechat/images/qiml_02.png">
        <span>政府机关</span>
    </a>
    <a class="a_icon" target="_self" onclick="queryComany('学校');">
        <img src="Content/wechat/images/qyml_03.png">
        <span>学校</span>
    </a>
    <a class="a_icon" target="_self" onclick="queryComany('医院');">
        <img src="Content/wechat/images/qyml_04.png">
        <span>医院</span>
    </a>
    <a class="a_icon" target="_self" onclick="queryComany('银行');">
        <img src="Content/wechat/images/qyml_05.png">
        <span>银行</span>
    </a>
</div>
<div>
    <div id="colist">


        <div class="qyml clearfix">
            <div class="qyml_l">
                <h3>漠河北区公安局</h3>
                <p>
                    <i>
                        <img src="Content/wechat/images/weizhi.png">
                    </i>
                    摩诃萨刀片区北大加油5-2号</p>
                <p>
                    <i>
                        <img src="Content/wechat/images/tel.png">
                    </i>
                    0451-86528885
                </p>
            </div>
            <div class="qyml_r">
                <a>
                    <img src="Content/wechat/images/tel_01.png">
                </a>
            </div>
        </div>


    </div>
    <div id="pagination" class="pagination"></div>

</div>


</body>
<script>
    window.onload = function () {
        InitAjax(1);
    }

</script>
<script>
    var pageTotal = 0;   //总页数
    var pageSize = 10;    //一页显示几个

    var cotype = "";


    function queryComany(type) {
        cotype = type;
        pageTotal = 0;
        InitAjax(1);
    }


    function onLoadPaging() {
        new myPagination({
            id: 'pagination',
            curPage: 1, //初始页码
            pageTotal: pageTotal, //总页数
            pageAmount: pageSize,  //每页多少条
            pageSize: 2, //可选,分页个数

            getPage: function (page) {
                //获取当前页数
                InitAjax(page)
            }
        })
    }

    function InitAjax(pageNum) {
        $.ajax({
            url: "/wechat/home/life/dwml/findcompanList",
            type: 'post',
            dataType: 'json',
            data: {
                pagination: "{page:\"" + pageNum + "\",rows:\"" + pageSize + "\",sidx:\"\",sord:\"\"}",
                compantype: cotype
            }, success: function (result) {
                ajaxCallBack(result);
            }

        })
    }

    function ajaxCallBack(data) {
        var insetViewData = ""; //视图数据
        $.each(data.data.rows, function (index, items) {

            insetViewData += "<div class=\"qyml clearfix\">\n" +
                "            <div class=\"qyml_l\"onclick=\"window.location.href='/wechat/home/life/dwml/affair_DWML_XQ?id="+items.id+"'\">\n" +
                "                <h3>"+items.companyname+"</h3>\n" +
                // "                <p>\n" +
                // "                    <i>\n" +
                // "                        <img src=\"Content/wechat/images/weizhi.png\">\n" +
                // "                    </i>\n" +
                // "                    "+items.communityname+items.villagename+items.buildingnumname+"</p>\n" +
                "                <p>\n" +
                "                    <i>\n" +
                "                        <img src=\"Content/wechat/images/tel.png\">\n" +
                "                    </i>\n" +
                "                    "+items.companyphone+"\n" +
                "                </p>\n" +
                "            </div>\n" +
                "            <div class=\"qyml_r\">\n" +
                "                <a href='tel:"+items.companyphone+"'>\n" +
                "                    <img src=\"Content/wechat/images/tel_01.png\">\n" +
                "                </a>\n" +
                "            </div>\n" +
                "        </div>";

        });
        $("#colist").html(insetViewData);
        if (pageTotal == 0) {
            pageTotal = data.data.total;
            onLoadPaging()
        }
    }


</script>
</html>